package com.etc.utils;

import java.net.URLEncoder;

public class AddFace {
	public static String add(String imgStr,String id) {
		String token = "24.a9a7c52139b1d5f64b36260e5193cf87.2592000.1558346983.282335-15832700";
		try {
			String imgParam = URLEncoder.encode(imgStr, "UTF-8");
			String param = "&image=" + imgParam + "&image_type=BASE64&group_id=group0001&user_id=user_"+id;
			String result = HttpUtil.post("https://aip.baidubce.com/rest/2.0/face/v3/faceset/user/add", token, param);
			System.out.println(result.toString());
			return result.toString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}